﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using EzDesk.Project.Service.Repositories.Interfaces;
using System.Diagnostics;
using EzDesk.Project.Model;

namespace EzDesk.Project.Service.Tests.Mock
{
    public class Mock_Repository<T> : IRepository<T>
        where T:IModel
    {        
        protected Mock_Storage<T> innerManager = new Mock_Storage<T>();

        public Guid Add(T model, bool saveChanges)
        {
            return innerManager.Add(model, saveChanges);
        }

        public T GetById(Guid id)
        {
            return innerManager.GetById(id);
        }

        public IQueryable<T> GetAll()
        {
            return innerManager.GetAll();
        }

        public void Delete(Guid id, bool saveChanges)
        {
            innerManager.Delete(id, saveChanges);
        }

        public void Update(T model, bool saveChanges)
        {
            innerManager.Update(model, saveChanges);
        }

        public void SaveChanges()
        {
            innerManager.SaveChanges();
        }
    }
}
